home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13449 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  41 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: extern func() declaration?
  5. Message-ID: <1996Apr6.164517.26340@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <316436C5.413E@micromedia.on.ca>
  11. Date: Sat, 6 Apr 1996 16:45:17 GMT
  12.  
  13. In article <316436C5.413E@micromedia.on.ca>, Richard Steadman <rsteadma@micromedia.on.ca> writes:
  14. >Hello. This is just a minor point, but I couldn't find the
  15. >answer in the FAQ:
  16. >
  17. >What's the difference between
  18. >
  19. >    extern int func(void);
  20. >
  21. >and
  22. >
  23. >    int func(void);
  24. >
  25. >when declaring functions located in another source file? They
  26. >both seem to work alright.
  27.  
  28. There is no difference. For such function declarations (note this
  29. proviso carefully ... because there *can* be a difference for
  30. variables!), the function declaration shown above without "extern" in
  31. front, defaults to being extern for final linking. This is normal.
  32.  
  33.                             Z
  34.  
  35.  
  36. -- 
  37. -------------------------------------------------------------------------
  38. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  39. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  40. -------------------------------------------------------------------------
  41.